package utfpr.si;

import jason.JasonException;

import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;

import utfpr.si.connection.Server;
/**
 * Classe que instancia o Jason e o Servidor
 * @author Ari
 * 
 */
public class JasonServer {
    public JasonServer() throws JasonException{
        String arg[] = new String[1];
        arg[0]="masMain.mas2j";
        jason.infra.centralised.RunCentralisedMAS.main(arg);
    }
    public static void main(String[] args) throws JasonException, RemoteException {
        //Servidor construido na porta 1313
        Server serv = new Server(1313);
        try {
            serv.initServer();
        } catch (java.rmi.AlreadyBoundException ex) {
            Logger.getLogger(JasonServer.class.getName()).log(Level.SEVERE, null, ex);
        }  catch (RemoteException ex) {
            Logger.getLogger(JasonServer.class.getName()).log(Level.SEVERE, null, ex);
        }
        //Jason
        new JasonServer();
    }    
}
